bitkeeper revision 1.201.1.1 (3eb284e4TXxmjVJxwkJfXMR3WFr5Vw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 2 May 2003 14:47:00 +0000 (14:47 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 2 May 2003 14:47:00 +0000 (14:47 +0000)
version.h, kernel.c, Rules.mk, Makefile:
  Fancy and informative banner is displayed when Xen boots.

xen/Makefile
xen/Rules.mk
xen/common/kernel.c
xen/include/xeno/version.h

index ab2bf1cb713078ba6001f2774b7d809037104127..1f169bdfe21ad42a59921980af6e1e8e0920f3c8 100644 (file)
@@ -1,6 +1,8 @@
 
 export BASEDIR := $(shell pwd)
 
+GENERATED_FILES := include/xeno/compile.h
+
 include Rules.mk
 
 default: $(TARGET)
@@ -19,9 +21,9 @@ clean: delete-links
        $(MAKE) -C net clean
        $(MAKE) -C drivers clean
        $(MAKE) -C arch/$(ARCH) clean
-       rm -f *.o $(TARGET)* *~ core
+       rm -f *.o $(TARGET)* *~ core $(GENERATED_FILES)
 
-$(TARGET): make-links
+$(TARGET): delete-unfresh-files make-links $(GENERATED_FILES)
        $(MAKE) -C tools
        $(MAKE) -C common
        $(MAKE) -C net
@@ -35,6 +37,23 @@ make-links: delete-links
 delete-links:
        rm -f include/linux include/asm
 
+# NB. kernel.o is blown away as the build date is stored statically within it
+#     Basically it's the only file dependent on compile.h -- we blow that
+#     dependency away for all other files in Rules.mk.
+delete-unfresh-files:
+       rm -f $(GENERATED_FILES) common/kernel.o
+
+include/xeno/compile.h:
+       @LANG=C echo \#define XEN_COMPILE_DATE \"`date`\" > $@
+       @LANG=C echo \#define XEN_COMPILE_TIME \"`date +%T`\" >> $@
+       @LANG=C echo \#define XEN_COMPILE_BY \"`whoami`\" >> $@
+       @LANG=C echo \#define XEN_COMPILE_DOMAIN \"`([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])`\" >> $@
+       @LANG=C echo \#define XEN_COMPILE_HOST \"`hostname`\" >> $@
+       @LANG=C echo \#define XEN_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -1`\" >> $@
+
+.PHONY: $(GENERATED_FILES) make-links delete-links default debug install clean delete-unfresh-files
+
+
 SUBDIRS         =arch common drivers net 
 TAGS: 
        etags `find include/asm-$(ARCH) -name '*.h'`
index 4e15dde1bfa8c189242a1e305429f278398d5925..73cb501d7f5be7d07cedd3032c560db9ab86fe8a 100644 (file)
@@ -6,6 +6,8 @@ HDRS    := $(wildcard $(BASEDIR)/include/xeno/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/scsi/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/hypervisor-ifs/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/asm-$(ARCH)/*.h)
+# compile.h is always regenerated, but other files shouldn't be rebuilt
+HDRS    := $(subst $(BASEDIR)/include/xeno/compile.h,,$(HDRS))
 
 C_SRCS  := $(wildcard *.c)
 S_SRCS  := $(wildcard *.S)
index 5ee3f2e3cb6178c188d51676c5cf4410fe74b37f..51cfd3403fa9f4f6bf214e9d203dbb5c2a7abc04 100644 (file)
@@ -8,6 +8,8 @@
 #include <xeno/delay.h>
 #include <xeno/skbuff.h>
 #include <xeno/interrupt.h>
+#include <xeno/compile.h>
+#include <xeno/version.h>
 #include <asm/io.h>
 #include <asm/msr.h>
 #include <asm/uaccess.h>
@@ -161,6 +163,19 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
     /* INITIALISE SERIAL LINE (printk will work okay from here on). */
     init_serial();
 
+    /* Print the intro banner. The ASCII art is ugle since '\\' -> '\'. */
+    printk(" __  __            _   ___    _          _        \n");
+    printk(" \\ \\/ /___ _ __   / | / _ \\  | |__   ___| |_ __ _ \n");
+    printk("  \\  // _ \\ '_ \\  | || | | | | '_ \\ / _ \\ __/ _` |\n");
+    printk("  /  \\  __/ | | | | || |_| | | |_) |  __/ || (_| |\n");
+    printk(" /_/\\_\\___|_| |_| |_(_)___/  |_.__/ \\___|\\__\\__,_|\n\n");
+    printk(" http://www.cl.cam.ac.uk/xeno\n");
+    printk(" University of Cambridge Computer Laboratory\n\n");
+    printk(" Xen version %d.%d%s (%s@%s) (%s) %s\n\n",
+           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
+           XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
+           XEN_COMPILER, XEN_COMPILE_DATE);
+
     memcpy(&idle0_task_union, &first_task_struct, sizeof(first_task_struct));
 
     max_page = (mbi->mem_upper+1024) >> (PAGE_SHIFT - 10);
@@ -350,7 +365,7 @@ static inline void __putstr(const char *str)
 void printf (const char *fmt, ...)
 {
     va_list args;
-    char buf[1024], *p;
+    char buf[128], *p;
     unsigned long flags;
 
     va_start(args, fmt);
@@ -366,7 +381,7 @@ void printf (const char *fmt, ...)
 void panic(const char *fmt, ...)
 {
     va_list args;
-    char buf[1024];
+    char buf[128];
     unsigned long flags;
     extern void machine_restart(char *);
     
index a0bbfa972f36621c9d7fb379c5f2935fee5eff63..33aa587b25d8e0c85efe03630eecf8d033b6216c 100644 (file)
@@ -1,2 +1,6 @@
 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
 #define LINUX_VERSION_CODE KERNEL_VERSION(2,4,21)
+
+#define XEN_VERSION      1
+#define XEN_SUBVERSION   0
+#define XEN_EXTRAVERSION "-beta"